var host = '//127.0.0.1:7001/api';
var Data = {
    getScene:function(callback){
        Vue.http.jsonp(host+'/public/scene/get',{params:{serverType:'ajax'}}).then(function(res){
            callback(res.data);
        })
    },

    getLottery:function(data,callback){
        data.serverType = 'ajax';
        Vue.http.jsonp(host+'/lottery/getLottery',{params:data}).then(function(res){
            callback(res.data);
        })
    },
    upLoadImg:function(fileElementId, callback){
      $.ajaxFileUpload({
        url: host + '/fileUpload/ajaxImageUpload.action',
        secureuri: false,
        fileElementId: fileElementId,
        dataType: 'json',
        success: function (data, status) {
          if (data.success) {
            var url = data.data.url + data.data.bucketName
            console.log('upload success:' + url)
            callback && callback(url);
          }
        },
        error: function (error) {
          console.log(error)
        }
      })
    }

};
module.exports = Data;
